<template>
  <wang-dialog-drag
    v-if="dialogVisible"
    ref="wangDialog"
    :dialog-visible="dialogVisible"
    :param="{ width: `80%`, title: '演示' }"
    @handleClose="handleClose"
  >
    <wang-title :sub-title="'321'" width-size="100px" />
    <template slot="footer">
      <el-button @click="handleClose">取 消</el-button>
    </template>
  </wang-dialog-drag>
</template>

<script>
export default {
  name: 'Inform',
  data() {
    return {
      dialogVisible: false
    }
  },
  created() {
    // 这里赋值会有一些问题 在this.dialogVisible = true;之后赋值没有问题
  },
  mounted() {},
  methods: {
    handleClose() {
      this.$confirm('确认关闭？')
        .then(() => {
          this.dialogVisible = false
        })
        .catch(() => {})
    },
    handleOpen() {
      Object.assign(this.$data, this.$options.data.call(this))
      this.dialogVisible = true
    }
  }
}
</script>

<style scoped lang="scss">
.formName {
  display: inline-block;
  width: 200px;
}
</style>
